.ScrollArea {
  box-sizing: border-box;
  width: 20rem;
  height: 20rem;
  max-width: calc(100vw - 8rem);
}

.Viewport {
  height: 100%;
  border-radius: 0.5rem;
  outline: 1px solid var(--color-gray-200);
  outline-offset: -1px;
  overscroll-behavior: contain;

  &:focus-visible {
    outline: 2px solid var(--color-blue);
  }
}

.Content {
  padding: 1.25rem;
}

.Grid {
  display: grid;
  grid-template-columns: repeat(10, 6.25rem);
  grid-template-rows: repeat(10, 6.25rem);
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.Item {
  border-radius: 0.5rem;
  background-color: var(--color-gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-gray-600);
}

.Scrollbar {
  display: flex;
  position: relative;
  background-color: var(--color-gray-200);
  border-radius: 0.375rem;
  margin: 0.5rem;
  opacity: 0;
  transition: opacity 150ms;
  pointer-events: none;

  &::before {
    content: '';
    position: absolute;
  }

  &[data-scrolling] {
    transition-duration: 0ms;
  }

  &[data-hovering],
  &[data-scrolling] {
    opacity: 1;
    pointer-events: auto;
  }

  &[data-orientation='vertical'] {
    width: 0.25rem;
    margin: 0.5rem;

    &::before {
      width: 1.25rem;
      height: 100%;
      left: 50%;
      transform: translateX(-50%);
    }
  }

  &[data-orientation='horizontal'] {
    height: 0.25rem;
    margin: 0.5rem;

    &::before {
      width: 100%;
      height: 1.25rem;
      left: 0;
      right: 0;
      bottom: -0.5rem;
    }
  }
}

.Thumb {
  width: 100%;
  border-radius: inherit;
  background-color: var(--color-gray-500);
}
